package com.lunatic.assistant.config;


import com.lunatic.assistant.service.impl.WeatherService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Description;

import java.util.function.Function;

@Configuration
public class FunctionCallConfig {

    @Description("获取天气") // 或者使用@JsonClassDescription 注释WeatherService.Request来提供函数描
    @Bean
    public Function<WeatherService.Request, WeatherService.Response> weatherFunction(WeatherService weatherService) {
        return weatherService::getWeather;
    }

    @Description("获取气温") // 或者使用@JsonClassDescription 注释WeatherService.Request来提供函数描
    @Bean
    public Function<WeatherService.Request, WeatherService.Response> getTemper(WeatherService weatherService) {
        return weatherService::getTemper;
    }

    @Description("订票") // 或者使用@JsonClassDescription 注释WeatherService.Request来提供函数描
    @Bean
    public Function<WeatherService.Request, WeatherService.Response> orderTik(WeatherService weatherService) {
        return weatherService::orderTik;
    }
}
